package cn.gson.fengboot.controller;


import cn.gson.fengboot.model.pojos.Qlianjiji;
import cn.gson.fengboot.model.pojos.Qproduct;
import cn.gson.fengboot.model.pojos.Qxinz;
import cn.gson.fengboot.model.service.QguigeService;
import cn.gson.fengboot.model.service.QproductService;
import cn.gson.fengboot.model.service.QxinzengggService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Controller
@RequestMapping("/pur")
public class ChanpcxContrpller {
    @Autowired
    QproductService qproductService;

    @Autowired
    QguigeService qguigeService;

    @Autowired
    QxinzengggService qxinzengggService;
    //产品查询
    @RequestMapping("/chanping-list")
    @ResponseBody
    public List<Qproduct> proList(String input){
        return qproductService.qproductList(input);
    }
    //产品新增
    @RequestMapping("/xinz-chanp")
    @ResponseBody
    public  void addkhtousu(@RequestBody Qxinz qxinz){
         qproductService.addkhtousu(qxinz);
    }
    //物理删除
    @RequestMapping("/delete-chanp")
    @ResponseBody
    public void deleteproduct(int id){
        qproductService.deleteproduct(id);
    }
    //新增页面查询
    @RequestMapping("/xinzenggg-list")
    @ResponseBody
    public List<Qlianjiji> xinzenggg(String value7){
        return qxinzengggService.xinzenggg(value7);
    }


}
